from django.shortcuts import render

# Create your views here.
from rest_framework.generics import ListAPIView
from rest_framework.pagination import PageNumberPagination

from operator_log.models import OperatorLog
from operator_log.serializers import OperatorLogSerializer


# 日志列表分页类-
class LogPagination(PageNumberPagination):
    page_size = 9
    # 向后台要多少条
    page_size_query_param = 'page_size'
    # 定制多少页的参数
    page_query_param = "page"
    max_page_size = 100


class LogView(ListAPIView):
    """日志的查看"""
    queryset = OperatorLog.objects.all()
    serializer_class = OperatorLogSerializer
    pagination_class = LogPagination
